//扩展artDialog，其实就是对一些常用的一个封装
$.extend(dialog,{
	//模拟alert弹出框
	alert:function(msg,callback){
		var d = dialog({
			title: '提示',
			content: "<div style=\"min-width:300px\">"+msg+"</div>",
			okValue: "确定",			
			ok: function () {
				if(callback)callback();
			},
			cancel:false
		});
		d.showModal();

	},
	//模拟confirm窗口
	confirm:function(msg,okCallback,cancleCallback){		
		var d = dialog({
			title: '提示',
			content: "<div style=\"min-width:300px\">"+msg+"</div>",
			okValue: '确定',
			ok: function () {
				if(okCallback)return okCallback();
			},
			cancelValue: '取消',
			cancel: function () {if(cancleCallback)return cancleCallback();}
		});
		d.showModal();
		
	
	},	
	//模拟prompt窗口
	//回调函数，返回false，窗口不会关闭
	prompt:function(msg,okCallback,cancleCallback){	
		var html=$("<div  class='promptMsg' style=\"min-width:300px\">"+msg+"：<br/><input class='promptInput'/></div>");
		
		var d = dialog({
			title: '提示',
			content: html,
			okValue: '确定',
			ok: function () {
			
				if(okCallback)return okCallback(html.children('.promptInput')[0].value);
			},
			cancelValue: '取消',
			cancel: function () {if(cancleCallback)return cancleCallback();}
		});
		d.showModal();
		
	
	},
	//从右下角弹出的通知
	notice : function (msg) {
		
		var d = dialog({
			title: '提示',
			content: "<div style=\"min-width:300px\">"+msg+"</div>",
			ok: false,
			cancel:true,
			cancelDisplay:false,
			disableReset:true,
			onshow:function(){

				var ele= $(this.__popup[0]);
				var h=ele.height();
				ele.css({
					position:'fixed',
					left:'auto',
					right:'0',
					top:'auto',
					bottom:-h
				});
				
				ele.animate({
					'bottom':0	
				},3*1000).
				delay(5000).animate({
					'bottom':-h	
				},3*1000,$.proxy( function(){
					this.close().remove();
				},this)).
				bind('mouseover',function(){
					$(this).stop();
				});
				
			}
		});
		d.show();
	}
});
